package com.yisu.auction.api.core.mapper;

import com.yisu.auction.api.domain.request.tradePackage.TradeRequest;
import com.yisu.auction.ewf.entity.CapitalFreeze;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

public interface CapitalFreezeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CapitalFreeze record);

    int insertSelective(CapitalFreeze record);

    CapitalFreeze selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CapitalFreeze record);

    int updateByPrimaryKey(CapitalFreeze record);

    /**
     * author: 赵杰
     * Business Description：通过prizeId和memberId扣除冻结金额
     * @param tradeRequest
     * @return
     */
    int deductFreezeAmount(TradeRequest tradeRequest);

    /**
     * author: 赵杰
     * Business Description：通过prizeId获取竞品冻结金额
     * @param prizeId
     * @return
     */
    BigDecimal getFreezeAmountByPrizeId(@Param("prizeId") long prizeId);
}